import request from "@/utils/request";
import type { GetUserInfoApiResponse } from "./type/infoType";
const enum Api {
  login = "/admin/acl/index/login",
  logout = "/admin/acl/index/logout",
  info = "/admin/acl/index/info",
}

// 登录
export const loginApi = (username: string, password: string) => {
  return request.post<any, { token: string }>(Api.login, {
    username,
    password,
  });
};
// 退出登录
export const logoutApi = () => {
  return request.post<any, null>(Api.logout);
};
// 登录后用户的信息
export const infoApi = () => {
  return request.get<any, GetUserInfoApiResponse>(Api.info);
};
